package com.yixun.qfbao.hander;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yixun.qfbao.api.service.CPService;
import com.yixun.qfbao.apidto.GetCPAppealPageReqDto;
import com.yixun.qfbao.apidto.GetCPAppealPageResDto;
import com.yixun.qfbao.dto.base.BaseRequestDTO;
import com.yixun.qfbao.dto.base.BaseResponseDTO;
import com.yixun.qfbao.hander.base.CommonAbstractHander;
import com.yixun.qfbao.vo.GetCPAppealPageReqVo;

/**
 * 客户报备申诉记录
 * 	分页
 * @author JHSong
 *		
 */
@Service("getCPAppealPageHander")
public class GetCPAppealPageHander extends CommonAbstractHander {
	private static final Logger logger = LoggerFactory.getLogger(GetCPAppealPageHander.class);
	@Autowired
	private CPService cpService;
	
	@SuppressWarnings("rawtypes")
	@Override
	public BaseResponseDTO doBusiness(BaseRequestDTO reqDto) {
		GetCPAppealPageReqVo req = (GetCPAppealPageReqVo)reqDto;
		GetCPAppealPageReqDto reqDto1 = req.getParams();
		BaseResponseDTO<GetCPAppealPageResDto> res = new BaseResponseDTO<GetCPAppealPageResDto>();
		GetCPAppealPageResDto resDto = new GetCPAppealPageResDto();
		try {
			resDto = cpService.getCPAppealPage(reqDto1);
		} catch (Exception e) {
			logger.error("getCPAppealPageHander err: {}", e);
			resDto.setResultMsg("获取报备分页失败," + e.getMessage());
		}
		res.setResData(resDto);
		res.setResult(resDto.getResult());
		return res;
	}
	
}
